<?php

namespace App\Console\Commands;

use App\HealthAdvice;
use Illuminate\Console\Command;
use DB;

class Text extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'test';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
//        $insert = [];
//        //取出数据
//        $datas = HealthAdvice::select('id', 'cover')->get();
//        foreach ($datas as $data) {
//            $insert[] = ['health_id' => $data->id, 'weight' => 1, 'path' => $data->cover];
//            $insert[] = ['health_id' => $data->id, 'weight' => 1, 'path' => $data->cover];
//            $insert[] = ['health_id' => $data->id, 'weight' => 1, 'path' => $data->cover];
//        }
//        if (!DB::table('health_pic')->insert($insert)) {
//            exit('失败');
//        }

        exit('成功');
    }
}
